package main.model.critters.genetics;

public enum GeneType {
	
	 SEXUALDISPLAYX		("Sexual display", Phenotype.SEXUALDISPLAY, Sex.FEMALE),
	 DISPLAYATTRACTIONX	("Display attraction", Phenotype.DISPLAYATTRACTION, Sex.FEMALE),
	 HAREMX				("Harem", Phenotype.HAREM, Sex.FEMALE),
	 HERDWITHOFFSPRINGX	("Herd with offspring", Phenotype.HERDWITHOFFSPRING, Sex.FEMALE),
	 HERDWITHMOTHERX	("Herd with mother", Phenotype.HERDWITHMOTHER, Sex.FEMALE),
	 HERDWITHFATHERX	("Herd with father", Phenotype.HERDWITHFATHER, Sex.FEMALE),
	 
	 SEXUALDISPLAYY		("Sexual display", Phenotype.SEXUALDISPLAY, Sex.MALE),
	 DISPLAYATTRACTIONY	("Display Attraction", Phenotype.DISPLAYATTRACTION, Sex.MALE),
	 HAREMY				("Harem", Phenotype.HAREM, Sex.MALE),
	 HERDWITHOFFSPRINGY	("Herd with offspring", Phenotype.HERDWITHOFFSPRING, Sex.MALE),
	 HERDWITHMOTHERY	("Herd with mother", Phenotype.HERDWITHMOTHER, Sex.MALE),
	 HERDWITHFATHERY	("Herd with father", Phenotype.HERDWITHFATHER, Sex.MALE),
	 
	 MUTATIONS	("Mutation rate", Phenotype.MUTATIONS, Sex.NONE),
	 SIZE		("Size", Phenotype.SIZE, Sex.NONE),
	 LIFESPAN 	("Lifespan", Phenotype.LIFESPAN, Sex.NONE),
     SENSORY 	("Sensory abilities", Phenotype.SENSORY, Sex.NONE),
     CAMOFLAGE 	("Camoflage", Phenotype.CAMOFLAGE, Sex.NONE),
     DEFENCE 	("Defensive capability", Phenotype.DEFENCE, Sex.NONE),
     ATTACK 	("Attacking capability", Phenotype.ATTACK, Sex.NONE),
     SPEED 		("Speed", Phenotype.SPEED, Sex.NONE),
     LITTERSIZE	("Litter size", Phenotype.LITTERSIZE, Sex.NONE),
     FAVTERRAIN	("Favoured Terrain", Phenotype.FAVTERRAIN, Sex.NONE),
     DIET		("Diet", Phenotype.DIET, Sex.NONE),
     FEAR 		("Skittishness", Phenotype.FEAR, Sex.NONE),
     HERDSIZE 	("Herd Size", Phenotype.HERDSIZE, Sex.NONE);
     
     private final String name;
     private final Phenotype phenotype;
     private final Sex sex;
	 
	 GeneType(String name, Phenotype phenotype, Sex sex){
		 this.name = name;
		 this.phenotype = phenotype;
		 this.sex = sex;
	 }
	 
	 public String getName(){return name;}
	 public Phenotype getPhenotype(){return phenotype;}
	 public Sex getSex(){return sex;}
	 
	 public static GeneType findGeneType(Phenotype p, Sex s){
		 for (GeneType g : GeneType.values()){
			 if(g.getPhenotype() == p && g.getSex() == s){
				 return g;
			 }
		 }
		 return null;
	 }
}
